/**
 * Created by John on 2016/6/23.
 */
var mongo = new Mongo('localhost');
var db = mongo.getDB("test");

db.addUser({
    user: 'dbadmin',
    pwd: 'test',
    roles: ['readWriteAnyDatabase', 'dbAdminAnyDatabase', 'clusterAdmin']
});

db.addUser({
    user: 'useradmin',
    pwd: 'test',
    roles: ['userAdminAnyDatabase']
});